﻿using ConfExpert.Forms.Base;
using DevExpress.XtraEditors;
using System;
using System.Windows.Forms;

namespace ConfExpert.Forms.Depo._7C
{
    public partial class EditCP : XForm
    {
        public string Execs = string.Empty;
        int CikisPartisiId, yon;
        public EditCP(int CikisPartisiId, int yon)
        {
            InitializeComponent();
            this.yon = yon;
            this.CikisPartisiId = CikisPartisiId;
            bbi.Caption = (yon == 1 ? "&Ekle" : "&Çıkar");
        }

        private void EditCP_Load(object sender, EventArgs e)
        {
            
            bbi.ItemClick += bbi_ItemClick;
        }

        void bbi_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {

            if (XtraMessageBox.Show("Emin misiniz?", "DİKKAT", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                ExecuteNonQuery("EditCP", CikisPartisiId, memoEdit1.Text.Replace(Environment.NewLine, ","), WhoAmI, yon);
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
        }
    }
}
